class ListNode {
  constructor (val, next) {
    this.val = val === undefined ? 0 : val
    this.next = next === undefined ? null : next
  }
}
// 建立链表步骤: 初始化各个节点对象 第二部构建引用指向关系
const n0 = new ListNode(1)
const n1 = new ListNode(3)
const n2 = new ListNode(2)
const n3 = new ListNode(5)
const n4 = new ListNode(5)
// 构建引用关系
n0.next = n1
n1.next = n2
n2.next = n3
n3.next = n4
console.log(JSON.stringify(n1));